<?php

/**
 * Fichier filter form base class.
 *
 * @package    jobeat
 * @subpackage filter
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 29570 2010-05-21 14:49:47Z Kris.Wallsmith $
 */
abstract class BaseFichierFormFilter extends BaseFormFilterDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'attrnomorigine'   => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'attrnomserver'    => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'attrtypefichier'  => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'attrurlfichier'   => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'attrtaille'       => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'attrextension'    => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'attrdatecreation' => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'attretat'         => new sfWidgetFormChoice(array('choices' => array('' => '', 'Validé' => 'Validé', 'Refusé' => 'Refusé', 'En Cours' => 'En Cours'))),
      'attrurlminiature' => new sfWidgetFormFilterInput(),
      'fkutilisateur'    => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'fkdossierparent'  => new sfWidgetFormFilterInput(array('with_empty' => false)),
    ));

    $this->setValidators(array(
      'attrnomorigine'   => new sfValidatorPass(array('required' => false)),
      'attrnomserver'    => new sfValidatorPass(array('required' => false)),
      'attrtypefichier'  => new sfValidatorPass(array('required' => false)),
      'attrurlfichier'   => new sfValidatorPass(array('required' => false)),
      'attrtaille'       => new sfValidatorPass(array('required' => false)),
      'attrextension'    => new sfValidatorPass(array('required' => false)),
      'attrdatecreation' => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'attretat'         => new sfValidatorChoice(array('required' => false, 'choices' => array('Validé' => 'Validé', 'Refusé' => 'Refusé', 'En Cours' => 'En Cours'))),
      'attrurlminiature' => new sfValidatorPass(array('required' => false)),
      'fkutilisateur'    => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'fkdossierparent'  => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
    ));

    $this->widgetSchema->setNameFormat('fichier_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'Fichier';
  }

  public function getFields()
  {
    return array(
      'id'               => 'Number',
      'attrnomorigine'   => 'Text',
      'attrnomserver'    => 'Text',
      'attrtypefichier'  => 'Text',
      'attrurlfichier'   => 'Text',
      'attrtaille'       => 'Text',
      'attrextension'    => 'Text',
      'attrdatecreation' => 'Number',
      'attretat'         => 'Enum',
      'attrurlminiature' => 'Text',
      'fkutilisateur'    => 'Number',
      'fkdossierparent'  => 'Number',
    );
  }
}
